/**************************************************************************************
 *  Copyright (c)  2010  Leszek Karcz.
 *  Permission is granted to copy, distribute and/or modify this document
 *  under the terms of the GNU Free Documentation License, Version 1.3
 *  or any later version published by the Free Software Foundation;
 *  with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
 *  A copy of the license is included in the section entitled "GNU
 *  Free Documentation License". 
 **************************************************************************************/
package view;
import java.awt.*;

import javax.swing.*;

import data.*;

/**************************************************************************************
 * Author(s): Leszek Karcz
 * This class displays the start screen text and selection
 **************************************************************************************/
public class StartScreenText extends JPanel
{
	private static final long serialVersionUID = 7132605929747344358L;
	private StartScreenData startScreenData;
	private int w,h,x,y;

	/**************************************************************************************
	 * Author(s): Leszek Karcz
	 * StartScreenText constructor
	 **************************************************************************************/
	public StartScreenText(StartScreenData startScreenData)
	{
		this.startScreenData=startScreenData;
		this.setFocusable(false);
		this.setOpaque(false);
		
		this.setLocation(0, 0);
		w = 1024;
		h = 600;
		x=0;
		y=0;
		
		this.setSize(w, h);
		this.setLocation(x, y);
	}

	/**************************************************************************************
	 * Author(s): Leszek Karcz
	 * paints/repaints the start screen text and selection
	 **************************************************************************************/
	public void paint(Graphics g)
	{
		this.setSize(w, h);
		this.setLocation(x, y);
		
		Font font = new Font("Arial", Font.BOLD, 20);
		g.setColor(Color.green);
		g.setFont(font);
		
		String[] commands = new String[]{"Land","Abort"};
		int selectedCommand=this.startScreenData.getSelected();
		
		for(int s=0;s<commands.length;s++)
		{
			g.setColor(Color.green);
			if(s==selectedCommand)
			{
				g.drawRect(440, 410+(s*25), 145, 25);
				g.drawRect(441, 411+(s*25), 143, 23);
			}
			if(s==1)
			{
				g.setColor(Color.red);
			}
			g.drawString(commands[s], 450, 430+(s*25));
		}
		
	}
}
